package com.detect.model;

/**
 * File Infomation class
 * 
 * @author Dylan
 */
public class FileInfo {

    private String filePath;

    private String fileName;

    private long fileSize;

    private FileType fileType;

    private String md5;

    public FileInfo() {

    }

    public FileInfo(String filePath, String fileName, int fileSize,
            FileType fileType) {
        this.filePath = filePath;
        this.fileName = fileName;
        this.fileSize = fileSize;
        this.fileType = fileType;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public long getFileSize() {
        return fileSize;
    }

    public void setFileSize(long fileSize) {
        this.fileSize = fileSize;
    }

    public FileType getFileType() {
        return fileType;
    }

    public void setFileType(FileType fileType) {
        this.fileType = fileType;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    @Override
    public boolean equals(Object obj) {
        // TODO Auto-generated method stub
        if (!getMd5().isEmpty() && getMd5().equals(((FileInfo) obj).getMd5()))
            return true;
        else
            return false;
    }

    @Override
    public int hashCode() {
        return getMd5().hashCode();
    }

}
